package com.bc.mes.service.impl;

import com.bc.mes.mbg.mapper.CalTeamMapper;
import com.bc.mes.mbg.model.schedule.CalTeam;
import com.bc.mes.mbg.model.schedule.CalTeamExample;
import com.bc.mes.service.calTeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version 1.0
 * @Author 小胤
 * @Date 2024/7/11 14:05
 * @注释
 */
@Service
public class calTeamServiceImpl implements calTeamService {
    @Autowired
    private CalTeamMapper calTeamMapper;
    /**
     * 查询班组信息
     * @param teamCode
     * @param teamName
     * @param calendarType
     * @return
     */
    @Override
    public List<CalTeam> select(String teamCode, String teamName, String calendarType) {
        CalTeamExample example = new CalTeamExample();
        CalTeamExample.Criteria criteria = example.createCriteria();
        if (teamCode != null) {
            criteria.andTeamCodeEqualTo(teamCode);
        }
        if (teamName != null) {
            criteria.andTeamNameEqualTo(teamName);
        }
        if (calendarType != null) {
            criteria.andCalendarTypeEqualTo(calendarType);
        }
        List<CalTeam> list = calTeamMapper.selectByExample(example);
        return list;
    }
}
